From cd741d6d73594f00e1aa9f3dbe2296c4b29f4e9a Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 25 Sep 2006 09:31:11 +0100 Subject: [PATCH] [XEN] Limit size of Xen heap to 2GB. Avoids stub code created on the stack being unable to reach targets in main Xen code via direct branches. Signed-off-by: Jan Beulich --- xen/arch/x86/setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index e21b4c2370..8e69ca3220 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -272,6 +272,13 @@ void __init __start_xen(multiboot_info_t *mbi) EARLY_FAIL(); } + /* + * Since there are some stubs getting built on the stacks which use + * direct calls/jumps, the heap must be confined to the lower 2G so + * that those branches can reach their targets. + */ + if ( opt_xenheap_megabytes > 2048 ) + opt_xenheap_megabytes = 2048; xenheap_phys_end = opt_xenheap_megabytes << 20; if ( mbi->flags & MBI_MEMMAP ) -- 2.30.2